package com.tjetc.service.Impl;

import com.tjetc.entity.SnowflakeIdWorker;
import org.springframework.stereotype.Service;

@Service
public class SnowflakeIdWorkerService {
    private SnowflakeIdWorker snowflakeIdWorker;

    /**
     * 生成用户id
     * @return 返回id
     */
    public Long generateUserId() {
        snowflakeIdWorker = new SnowflakeIdWorker(1,1);
        return snowflakeIdWorker.nextId();
    }
}